home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / unix.subproj / lock.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  17.1 KB  |  691 lines

  1. /* lock.c
  2.    Lock and unlock a file name.
  3.  
  4.    Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
  5.  
  6.    This file is part of the Taylor UUCP package.
  7.  
  8.    This program is free software; you can redistribute it and/or
  9.    modify it under the terms of the GNU General Public License as
  10.    published by the Free Software Foundation; either version 2 of the
  11.    License, or (at your option) any later version.
  12.  
  13.    This program is distributed in the hope that it will be useful, but
  14.    WITHOUT ANY WARRANTY; without even the implied warranty of
  15.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.    General Public License for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with this program; if not, write to the Free Software
  20.    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  21.  
  22.    The author of the program may be contacted at ian@airs.com or
  23.    c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144.
  24.    */
  25.  
  26. #include "uucp.h"
  27.  
  28. #if USE_RCS_ID
  29. const char lock_rcsid[] = "$Id: lock.c,v 1.20 1995/06/21 19:19:38 ian Rel $";
  30. #endif
  31.  
  32. #include "uudefs.h"
  33. #include "sysdep.h"
  34. #include "system.h"
  35.  
  36. #include <errno.h>
  37. #include <ctype.h>
  38.  
  39. #if HAVE_FCNTL_H
  40. #include <fcntl.h>
  41. #else
  42. #if HAVE_SYS_FILE_H
  43. #include <sys/file.h>
  44. #endif
  45. #endif
  46.  
  47. #if TM_IN_SYS_TIME
  48. #include <sys/time.h>
  49. #else
  50. #include <time.h>
  51. #endif
  52.  
  53. #if HAVE_QNX_LOCKFILES
  54. #include <sys/kernel.h>
  55. #include <sys/psinfo.h>
  56. #include <sys/seginfo.h>
  57. #include <sys/vc.h>
  58. #endif
  59.  
  60. #ifndef O_RDONLY
  61. #define O_RDONLY 0
  62. #define O_WRONLY 1
  63. #define O_RDWR 2
  64. #endif
  65.  
  66. #ifndef O_NOCTTY
  67. #define O_NOCTTY 0
  68. #endif
  69.  
  70. #ifndef SEEK_SET
  71. #define SEEK_SET 0
  72. #endif
  73.  
  74. #ifndef localtime
  75. extern struct tm *localtime ();
  76. #endif
  77.  
  78. #if HAVE_QNX_LOCKFILES
  79. static boolean fsqnx_stale P((unsigned long ipid, unsigned long inme,
  80.                  unsigned long inid, boolean *pferr));
  81. #endif
  82.  
  83. /* Lock something.  If the fspooldir argument is TRUE, the argument is
  84.    a file name relative to the spool directory; otherwise the argument
  85.    is a simple file name which should be created in the system lock
  86.    directory (under HDB this is /etc/locks).  */
  87.  
  88. boolean
  89. fsdo_lock (zlock, fspooldir, pferr)
  90.      const char *zlock;
  91.      boolean fspooldir;
  92.      boolean *pferr;
  93. {
  94.   char *zfree;
  95.   const char *zpath, *zslash;
  96.   size_t cslash;
  97.   pid_t ime;
  98.   char *ztempfile;
  99.   char abtempfile[sizeof "TMP12345678901234567890"];
  100.   int o;
  101. #if HAVE_QNX_LOCKFILES
  102.   nid_t inme;
  103.   char ab[23];
  104.   char *zend;
  105. #else
  106. #if HAVE_V2_LOCKFILES
  107.   int i;
  108. #else
  109.   char ab[12];
  110. #endif
  111. #endif
  112.   int cwrote;
  113.   const char *zerr;
  114.   boolean fret;
  115.  
  116.   if (pferr != NULL)
  117.     *pferr = TRUE;
  118.  
  119.   if (fspooldir)
  120.     {
  121.       zfree = NULL;
  122.       zpath = zlock;
  123.     }
  124.   else
  125.     {
  126.       zfree = zsysdep_in_dir (zSlockdir, zlock);
  127.       zpath = zfree;
  128.     }
  129.  
  130.   ime = getpid ();
  131. #if HAVE_QNX_LOCKFILES
  132.   inme = getnid ();
  133. #endif
  134.  
  135.   /* We do the actual lock by creating a file and then linking it to
  136.      the final file name we want.  This avoids race conditions due to
  137.      one process checking the file before we have finished writing it,
  138.      and also works even if we are somehow running as root.
  139.  
  140.      First, create the file in the right directory (we must create the
  141.      file in the same directory since otherwise we might attempt a
  142.      cross-device link).  */
  143.   zslash = strrchr (zpath, '/');
  144.   if (zslash == NULL)
  145.     cslash = 0;
  146.   else
  147.     cslash = zslash - zpath + 1;
  148.  
  149. #if HAVE_QNX_LOCKFILES
  150.   sprintf (abtempfile, "TMP%010lx%010lx", (unsigned long) ime,
  151.        (unsigned long) inme);
  152. #else
  153.   sprintf (abtempfile, "TMP%010lx", (unsigned long) ime);
  154. #endif
  155.   ztempfile = zbufalc (cslash + sizeof abtempfile);
  156.   memcpy (ztempfile, zpath, cslash);
  157.   memcpy (ztempfile + cslash, abtempfile, sizeof abtempfile);
  158.  
  159.   o = creat (ztempfile, IPUBLIC_FILE_MODE);
  160.   if (o < 0)
  161.     {
  162.       if (errno == ENOENT)
  163.     {
  164.       if (! fsysdep_make_dirs (ztempfile, FALSE))
  165.         {
  166.           ubuffree (zfree);
  167.           ubuffree (ztempfile);
  168.           return FALSE;
  169.         }
  170.       o = creat (ztempfile, IPUBLIC_FILE_MODE);
  171.     }
  172.       if (o < 0)
  173.     {
  174.       ulog (LOG_ERROR, "creat (%s): %s", ztempfile, strerror (errno));
  175.       ubuffree (zfree);
  176.       ubuffree (ztempfile);
  177.       return FALSE;
  178.     }
  179.     }
  180.  
  181. #if HAVE_QNX_LOCKFILES
  182.   sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
  183.   cwrote = write (o, ab, strlen (ab));
  184. #else
  185. #if HAVE_V2_LOCKFILES
  186.   i = (int) ime;
  187.   cwrote = write (o, &i, sizeof i);
  188. #else
  189.   sprintf (ab, "%10ld\n", (long) ime);
  190.   cwrote = write (o, ab, strlen (ab));
  191. #endif
  192. #endif
  193.  
  194.   zerr = NULL;
  195.   if (cwrote < 0)
  196.     zerr = "write";
  197.   if (close (o) < 0)
  198.     zerr = "close";
  199.   if (zerr != NULL)
  200.     {
  201.       ulog (LOG_ERROR, "%s (%s): %s", zerr, ztempfile, strerror (errno));
  202.       (void) remove (ztempfile);
  203.       ubuffree (zfree);
  204.       ubuffree (ztempfile);
  205.       return FALSE;
  206.     }
  207.  
  208.   /* Now try to link the file we just created to the lock file that we
  209.      want.  If it fails, try reading the existing file to make sure
  210.      the process that created it still exists.  We do this in a loop
  211.      to make it easy to retry if the old locking process no longer
  212.      exists.  */
  213.   fret = TRUE;
  214.   if (pferr != NULL)
  215.     *pferr = FALSE;
  216.   o = -1;
  217.   zerr = NULL;
  218.  
  219.   while (link (ztempfile, zpath) != 0)
  220.     {
  221.       int cgot;
  222.       pid_t ipid;
  223.       boolean freadonly;
  224.       struct stat st;
  225.       char abtime[sizeof "1991-12-31 12:00:00"];
  226. #if HAVE_QNX_LOCKFILES
  227.       nid_t inid;
  228. #endif
  229.  
  230.       fret = FALSE;
  231.  
  232.       if (errno != EEXIST)
  233.     {
  234.       ulog (LOG_ERROR, "link (%s, %s): %s", ztempfile, zpath,
  235.         strerror (errno));
  236.       if (pferr != NULL)
  237.         *pferr = TRUE;
  238.       break;
  239.     }
  240.  
  241.       freadonly = FALSE;
  242.       o = open ((char *) zpath, O_RDWR | O_NOCTTY, 0);
  243.       if (o < 0)
  244.     {
  245.       if (errno == EACCES)
  246.         {
  247.           freadonly = TRUE;
  248.           o = open ((char *) zpath, O_RDONLY, 0);
  249.         }
  250.       if (o < 0)
  251.         {
  252.           if (errno == ENOENT)
  253.         {
  254.           /* The file was presumably removed between the link
  255.              and the open.  Try the link again.  */
  256.           fret = TRUE;
  257.           continue;
  258.         }
  259.           zerr = "open";
  260.           break;
  261.         }
  262.     }
  263.  
  264.       /* The race starts here.  See below for a discussion.  */
  265.  
  266. #if HAVE_V2_LOCKFILES
  267.       cgot = read (o, &i, sizeof i);
  268. #else
  269.       cgot = read (o, ab, sizeof ab - 1);
  270. #endif
  271.  
  272.       if (cgot < 0)
  273.     {
  274.       zerr = "read";
  275.       break;
  276.     }
  277.  
  278. #if DEBUG > 0
  279. #if HAVE_V2_LOCKFILES
  280.       {
  281.     char ab[10];
  282.  
  283.     if (read (o, ab, sizeof ab) > 4
  284.         && isdigit (BUCHAR (ab[0])))
  285.       ulog (LOG_ERROR,
  286.         "Lock file %s may be HDB format; check LOCKFILES in policy.h",
  287.         zpath);
  288.       }
  289. #else
  290.       if (cgot == 4)
  291.     ulog (LOG_ERROR,
  292.           "Lock file %s may be V2 format; check LOCKFILES in policy.h",
  293.           zpath);
  294. #endif
  295. #endif /* DEBUG > 0 */
  296.  
  297. #if HAVE_QNX_LOCKFILES
  298.       ab[cgot] = '\0';
  299.       ipid = (pid_t) strtol (ab, &zend, 10);
  300.       inid = (nid_t) strtol (zend, (char **) NULL, 10);
  301. #else
  302. #if HAVE_V2_LOCKFILES
  303.       ipid = (pid_t) i;
  304. #else
  305.       ab[cgot] = '\0';
  306.       ipid = (pid_t) strtol (ab, (char **) NULL, 10);
  307. #endif
  308. #endif
  309.  
  310.       /* On NFS, the link might have actually succeeded even though we
  311.      got a failure return.  This can happen if the original
  312.      acknowledgement was lost or delayed and the operation was
  313.      retried.  In this case the pid will be our own.  This
  314.      introduces a rather improbable race condition: if a stale
  315.      lock was left with our process ID in it, and another process
  316.      just did the kill, below, but has not yet changed the lock
  317.      file to hold its own process ID, we could start up and make
  318.      it all the way to here and think we have the lock.  I'm not
  319.      going to worry about this possibility.  */
  320.       if (ipid == ime)
  321.     {
  322. #if HAVE_QNX_LOCKFILES
  323.       if (inid == inme)
  324. #endif
  325.         {
  326.           fret = TRUE;
  327.           break;
  328.         }
  329.     }
  330.  
  331.       /* If the lock file is empty (cgot == 0), we assume that it is
  332.          stale.  This can happen if the system crashed after the lock
  333.          file was created but before the process ID was written out.  */
  334.       if (cgot > 0)
  335.     {
  336. #if HAVE_QNX_LOCKFILES
  337.       if (! fsqnx_stale ((unsigned long) ipid, (unsigned long) inme,
  338.                  (unsigned long) inid, pferr))
  339.         break;
  340. #else
  341.       /* If the process still exists, we will get EPERM rather
  342.          than ESRCH.  We then return FALSE to indicate that we
  343.          cannot make the lock.  */
  344.       if (kill (ipid, 0) == 0 || errno == EPERM)
  345.         break;
  346. #endif
  347.     }
  348.  
  349.       if (fstat (o, &st) < 0)
  350.     strcpy (abtime, "unknown");
  351.       else
  352.     {
  353.       time_t itm;
  354.       struct tm *q;
  355.  
  356.       itm = (time_t) st.st_mtime;
  357.       q = localtime (&itm);
  358.       sprintf (abtime, "%04d-%02d-%02d %02d:%02d:%02d",
  359.            q->tm_year + 1900, q->tm_mon + 1, q->tm_mday, q->tm_hour,
  360.            q->tm_min, q->tm_sec);
  361.     }
  362.  
  363. #if HAVE_QNX_LOCKFILES
  364.       ulog (LOG_ERROR,
  365.         "Stale lock %s held by process %ld on node %ld created %s",
  366.         zpath, (long) ipid, (long) inid, abtime);
  367. #else
  368.       ulog (LOG_ERROR, "Stale lock %s held by process %ld created %s",
  369.         zpath, (long) ipid, abtime);
  370. #endif
  371.  
  372.       /* This is a stale lock, created by a process that no longer
  373.      exists.
  374.  
  375.      Now we could remove the file (and, if the file mode disallows
  376.      writing, that's what we have to do), but we try to avoid
  377.      doing so since it causes a race condition.  If we remove the
  378.      file, and are interrupted any time after we do the read until
  379.      we do the remove, another process could get in, open the
  380.      file, find that it was a stale lock, remove the file and
  381.      create a new one.  When we regained control we would remove
  382.      the file the other process just created.
  383.  
  384.      These files are being generated partially for the benefit of
  385.      cu, and it would be nice to avoid the race however cu avoids
  386.      it, so that the programs remain compatible.  Unfortunately,
  387.      nobody seems to know how cu avoids the race, or even if it
  388.      tries to avoid it at all.
  389.  
  390.      There are a few ways to avoid the race.  We could use kernel
  391.      locking primitives, but they may not be available.  We could
  392.      link to a special file name, but if that file were left lying
  393.      around then no stale lock could ever be broken (Henry Spencer
  394.      would think this was a good thing).
  395.  
  396.      Instead I've implemented the following procedure: seek to the
  397.      start of the file, write our pid into it, sleep for five
  398.      seconds, and then make sure our pid is still there.  Anybody
  399.      who checks the file while we're asleep will find our pid
  400.      there and fail the lock.  The only race will come from
  401.      another process which has done the read by the time we do our
  402.      write.  That process will then have five seconds to do its
  403.      own write.  When we wake up, we'll notice that our pid is no
  404.      longer in the file, and retry the lock from the beginning.
  405.  
  406.      This relies on the atomicity of write(2).  If it possible for
  407.      the writes of two processes to be interleaved, the two
  408.      processes could livelock.  POSIX unfortunately leaves this
  409.      case explicitly undefined; however, given that the write is
  410.      of less than a disk block, it's difficult to imagine an
  411.      interleave occurring.
  412.  
  413.      Note that this is still a race.  If it takes the second
  414.      process more than five seconds to do the kill, the lseek, and
  415.      the write, both processes will think they have the lock.
  416.      Perhaps the length of time to sleep should be configurable.
  417.      Even better, perhaps I should add a configuration option to
  418.      use a permanent lock file, which eliminates any race and
  419.      forces the installer to be aware of the existence of the
  420.      permanent lock file.
  421.  
  422.      We stat the file after the sleep, to make sure some other
  423.      program hasn't deleted it for us.  */
  424.       if (freadonly)
  425.     {
  426.       (void) close (o);
  427.       o = -1;
  428.       (void) remove (zpath);
  429.       fret = TRUE;
  430.       continue;
  431.     }
  432.  
  433.       if (lseek (o, (off_t) 0, SEEK_SET) != 0)
  434.     {
  435.       zerr = "lseek";
  436.       break;
  437.     }
  438.  
  439. #if HAVE_QNX_LOCKFILES
  440.       sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
  441.       cwrote = write (o, ab, strlen (ab));
  442. #else
  443. #if HAVE_V2_LOCKFILES
  444.       i = (int) ime;
  445.       cwrote = write (o, &i, sizeof i);
  446. #else
  447.       sprintf (ab, "%10ld\n", (long) ime);
  448.       cwrote = write (o, ab, strlen (ab));
  449. #endif
  450. #endif
  451.  
  452.       if (cwrote < 0)
  453.     {
  454.       zerr = "write";
  455.       break;
  456.     }
  457.  
  458.       (void) sleep (5);
  459.  
  460.       if (lseek (o, (off_t) 0, SEEK_SET) != 0)
  461.     {
  462.       zerr = "lseek";
  463.       break;
  464.     }
  465.  
  466. #if HAVE_V2_LOCKFILES
  467.       cgot = read (o, &i, sizeof i);
  468. #else
  469.       cgot = read (o, ab, sizeof ab - 1);
  470. #endif
  471.  
  472.       if (cgot < 0)
  473.     {
  474.       zerr = "read";
  475.       break;
  476.     }
  477.  
  478. #if HAVE_QNX_LOCKFILES
  479.       ab[cgot] = '\0';
  480.       ipid = (pid_t) strtol (ab, &zend, 10);
  481.       inid = (nid_t) strtol (zend, (char **) NULL, 10);
  482. #else
  483. #if HAVE_V2_LOCKFILES
  484.       ipid = (pid_t) i;
  485. #else
  486.       ab[cgot] = '\0';
  487.       ipid = (pid_t) strtol (ab, (char **) NULL, 10);
  488. #endif
  489. #endif
  490.  
  491.       if (ipid == ime)
  492.     {
  493. #if HAVE_QNX_LOCKFILES
  494.       if (inid == inme)
  495. #endif
  496.         {
  497.           struct stat sfile, sdescriptor;
  498.  
  499.           /* It looks like we have the lock.  Do the final stat
  500.          check.  */
  501.           if (stat ((char *) zpath, &sfile) < 0)
  502.         {
  503.           if (errno != ENOENT)
  504.             {
  505.               zerr = "stat";
  506.               break;
  507.             }
  508.           /* Loop around and try again.  */
  509.         }
  510.           else
  511.         {
  512.           if (fstat (o, &sdescriptor) < 0)
  513.             {
  514.               zerr = "fstat";
  515.               break;
  516.             }
  517.  
  518.           if (sfile.st_ino == sdescriptor.st_ino
  519.               && sfile.st_dev == sdescriptor.st_dev)
  520.             {
  521.               /* Close the file before assuming we've
  522.              succeeded to pick up any trailing errors.  */
  523.               if (close (o) < 0)
  524.             {
  525.               zerr = "close";
  526.               break;
  527.             }
  528.  
  529.               o = -1;
  530.  
  531.               /* We have the lock.  */
  532.               fret = TRUE;
  533.               break;
  534.             }
  535.         }
  536.         }
  537.     }
  538.  
  539.       /* Loop around and try the lock again.  We keep doing this until
  540.      the lock file holds a pid that exists.  */
  541.       (void) close (o);
  542.       o = -1;
  543.       fret = TRUE;
  544.     }
  545.  
  546.   if (zerr != NULL)
  547.     {
  548.       ulog (LOG_ERROR, "%s (%s): %s", zerr, zpath, strerror (errno));
  549.       if (pferr != NULL)
  550.     *pferr = TRUE;
  551.     }
  552.  
  553.   if (o >= 0)
  554.     (void) close (o);
  555.  
  556.   ubuffree (zfree);
  557.  
  558.   /* It would be nice if we could leave the temporary file around for
  559.      future calls, but considering that we create lock files in
  560.      various different directories it's probably more trouble than
  561.      it's worth.  */
  562.   if (remove (ztempfile) != 0)
  563.     ulog (LOG_ERROR, "remove (%s): %s", ztempfile, strerror (errno));
  564.  
  565.   ubuffree (ztempfile);
  566.  
  567.   return fret;
  568. }
  569.  
  570. /* Unlock something.  The fspooldir argument is as in fsdo_lock.  */
  571.  
  572. boolean
  573. fsdo_unlock (zlock, fspooldir)
  574.      const char *zlock;
  575.      boolean fspooldir;
  576. {
  577.   char *zfree;
  578.   const char *zpath;
  579.  
  580.   if (fspooldir)
  581.     {
  582.       zfree = NULL;
  583.       zpath = zlock;
  584.     }
  585.   else
  586.     {
  587.       zfree = zsysdep_in_dir (zSlockdir, zlock);
  588.       zpath = zfree;
  589.     }
  590.  
  591.   if (remove (zpath) == 0
  592.       || errno == ENOENT)
  593.     {
  594.       ubuffree (zfree);
  595.       return TRUE;
  596.     }
  597.   else
  598.     {
  599.       ulog (LOG_ERROR, "remove (%s): %s", zpath, strerror (errno));
  600.       ubuffree (zfree);
  601.       return FALSE;
  602.     }
  603. }
  604.  
  605. #if HAVE_QNX_LOCKFILES
  606.  
  607. /* Return TRUE if the lock is stale.  */
  608.  
  609. static boolean
  610. fsqnx_stale (ipid, inme, inid, pferr)
  611.      unsigned long ipid;
  612.      unsigned long inme;
  613.      unsigned long inid;
  614.      boolean *pferr;
  615. {
  616.   /* A virtual process ID.  This virtual process ID, which will exist
  617.      on the local node, will represent the process ID of the process
  618.      manager process (Proc) on the remote node. */
  619.   pid_t ivid;
  620.   /* The return value of the qnx_psinfo function.  This is either a
  621.      process ID which might or might not be the same as the process
  622.      being looked for, or -1 to indicate no process found. */
  623.   pid_t ifound_pid;
  624.   /* This holds the actual result of qnx_psinfo.  We will ignore
  625.      almost all the fields since we're just checking for existence. */
  626.   struct _psinfo spsdata;
  627.  
  628.   /* Establish connection with a remote process manager if necessary. */
  629.   if (inid != inme)
  630.     {
  631.       ivid = qnx_vc_attach (inid /* remote node ID */,
  632.                 PROC_PID /* pid of process manager */,
  633.                 1000 /* initial buffer size */,
  634.                 0    /* flags */);
  635.       if (ivid < 0)
  636.     {
  637.       ulog (LOG_ERROR, "qnx_vc_attach (%lu, PROC_PID): %s",
  638.         inid, strerror (errno));
  639.       if (pferr != NULL)
  640.         *pferr = TRUE;
  641.       return FALSE;
  642.     }
  643.     }
  644.   else
  645.     {
  646.       /* Use the local pid of the local process manager. */
  647.       ivid = PROC_PID;
  648.     }
  649.         
  650.   /* Request the process information. */
  651.   ifound_pid = qnx_psinfo (ivid /* process manager handling request */,
  652.                ipid /* get info on this process */,
  653.                &spsdata /* put info in this struct */,
  654.                0    /* unused */,
  655.                (struct _seginfo *) NULL /* unused */);
  656.  
  657.   /* Deallocate the virtual connection before continuing. */
  658.   {
  659.     int isaved_errno = errno;
  660.     if (qnx_vc_detach (ivid) < 0)
  661.       ulog (LOG_ERROR, "qnx_vd_detach (%ld): %s", (long) ivid,
  662.         strerror (errno));
  663.     errno = isaved_errno;
  664.   }
  665.           
  666.   /* If the returned pid matches then the process still holds the lock. */
  667.   if ((ifound_pid == ipid) && (spsdata.pid == ipid))
  668.     return FALSE;
  669.  
  670.   /* If the returned pid is positive and doesn't match, then the
  671.      process doesn't exist and the lock is stale.  Continue. */
  672.  
  673.   /* If the returned pid is negative (-1) and errno is EINVAL (or ESRCH
  674.      in older versions of QNX), then the process doesn't exist and the
  675.      lock is stale.  Continue. */
  676.  
  677.   /* Check for impossible errors. */
  678.   if ((ifound_pid < 0) && (errno != ESRCH) && (errno != EINVAL))
  679.     {
  680.       ulog (LOG_ERROR, "qnx_psinfo (%ld, %ld): %s", (long) ivid,
  681.         (long) ipid, strerror (errno));
  682.       /* Since we don't know what the hell this means, and we don't
  683.      want our system to freeze, we treat this case as a stale
  684.      lock.  Continue on. */
  685.     }
  686.  
  687.   return TRUE;
  688. }
  689.  
  690. #endif /* HAVE_QNX_LOCKFILES */
  691.